﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;

namespace BattleforgeAssault
{
    public static class Types
    {
        public enum Phases
        {
            StartOfTurn, Kingdom, Quest, Capital, Battlefield, EndOfTurn, None
        }

        public enum States
        {
            Setup, Playing, Ended, Targeting, Querying
        }

        public enum Races
        {
            Dwarf, Orc, Empire, DarkElf, HighElf, Chaos, Neutral
        }

        public enum Traits
        {
            Attachment, Banner, Building, Cavalry, Condition, Creature, Daemon, Disease, Elite, Engineer, EpicSpell, Goblin, Hero, Hex, Initiate, Knight, Location, Mage, Martyr, Messenger, Mutation, Noble, Priest, Range, Relic, Rune, Shaman, Siege, Skaven, Skill, Slayer, Sorceror, Spell, Warpstone, Warrior, Weapon, Witchhunter, Zealot
        }

        public enum Keywords
        {
            BattlefieldOnly, QuestOnly, KingdomOnly, DestructionOnly, OrderOnly, Scout, Toughness, Counterstrike, Limited, Savage, Necromancy
        }

        public enum Sets
        {
            Core = 1, CorruptionCycle = 2, AssaultOnUlthuan = 3, EnemyCycle = 4, MarchOfTheDamned = 5
        }

        public static int GetWebSetNumber(Sets set, int number)
        {
            // TODO: make this return the set number based on the web set numbering scheme
            switch (set)
            {
                case Sets.Core:
                    return 1;
                case Sets.CorruptionCycle:
                    if ((number >= 1) & (number <= 20)) return 2;
                    if ((number >= 21) & (number <= 40)) return 3;
                    if ((number >= 41) & (number <= 60)) return 4;
                    if ((number >= 61) & (number <= 80)) return 5;
                    if ((number >= 81) & (number <= 100)) return 7;
                    if ((number >= 101) & (number <= 120)) return 8;
                    return 0; // Number given was out of bounds for this set
                case Sets.AssaultOnUlthuan:
                    return 6;
                case Sets.EnemyCycle:
                    if ((number >= 1) & (number <= 20)) return 9;
                    if ((number >= 21) & (number <= 40)) return 10;
                    if ((number >= 41) & (number <= 60)) return 11;
                    if ((number >= 61) & (number <= 80)) return 13;
                    if ((number >= 81) & (number <= 100)) return 14;
                    if ((number >= 101) & (number <= 120)) return 15;
                    return 0; // Number given was out of bounds for this set
                case Sets.MarchOfTheDamned:
                    return 12;
                default:
                    return 0;  //Set given was out of bounds
            } 
        }
    } // Class
} // Namespace
